<?php

$appid = 'wxe46b72ee02d38782';
$redirect_uri = urlencode('http://shoper.wzcrkj.com/wechat.php');//重定向地址

$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";

if(isset($_GET["code"])){
    $code = $_GET["code"];
    die('CODE:'.$code);
}
header("Location:" . $url);
